package com.bobi.ecofavor.model.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 店铺
 * </p>
 *
 * @author wenyuan
 * @since 2023-10-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("bobi_store")
@ApiModel(value = "Store对象", description = "店铺")
public class Store extends Model<Store> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "店铺主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "店铺名")
    private String storeName;

    @ApiModelProperty(value = "地址")
    private String storeAddress;

    @ApiModelProperty(value = "老板名字")
    private String bossName;

    @ApiModelProperty(value = "身份证号码")
    private String idcard;

    @ApiModelProperty(value = "营业执照图片")
    private String businessLicense;

    @ApiModelProperty(value = "电话号码")
    private String phoneNumber;

    @ApiModelProperty(value = "店铺状态(关闭、正常营业)")
    private Integer storeStatus;

    @ApiModelProperty(value = "店铺分类")
    private Integer storeCategory;

    @ApiModelProperty(value = "收藏数量")
    private Integer collectNum;

    @ApiModelProperty(value = "销售数量")
    private Integer orderNum;

    @ApiModelProperty(value = "评分")
    private Float score;

    @ApiModelProperty(value = "店铺的侧边栏")
    private String goodsClasses;

    @ApiModelProperty(value = "经度")
    private String longitude;

    @ApiModelProperty(value = "纬度")
    private String latitude;


    @ApiModelProperty(value = "店铺图片")
    private String storePhoto;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "更改时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime updateTime;

    @TableLogic
    @ApiModelProperty(value = "逻辑删除")
    private Boolean isDeleted;

    @TableField(exist = false)
    private double distance;

    @TableField(exist = false)
    private List<UserStore> userStore;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
